package first.users;

/**
 * Abstract class, that describes general structure of library user
 * 
 * @author Kozlov Kirill
 * @version v.0
 * 
 * */
public abstract class BiblioUser 
{	
	public enum UserType{ ADMIN, READER, LIBRARIAN};
	
	/**
	 * Name of library user
	 */
	private String userName;
	
	/**
	 * Login of library user
	 */
	private String userLogin;
	/**
	 * Authentication password of library user  
	 */
	private String userPassword;
	/**
	 * Identification number of library user
	 */
	private int userId;
	
	/**
	 * Access rights of library user
	 */
	private String userType; 
	
//=====================================================================================================
//=====================================================================================================

	/**
	 * Constructor for general structure of library user
	 * 
	 * @param userName name of library user
	 * 
	 * @param userPassword authentication password of library user
	 * */
	public BiblioUser(String userLogin,String userName,String userPassword,int userID)
	{
		this.userLogin=userLogin;
		this.userName=userName;
		this.userPassword=userPassword; 
		this.setUserType("reader");
		this.userId=userID;
	}
	
	public BiblioUser(String userLogin,String userName,String userPassword,String userType,int userID)
	{
		this.userLogin=userLogin;
		this.userName=userName;
		this.userPassword=userPassword; 
		this.setUserType(userType);
		this.userId=userID;
	}
	
//=====================================================================================================
//=====================================================================================================
	
	/**
	 * Method returns name of the current library user
	 * 
	 * @return userName
	 */
	
	public String getName()
	{	
		return this.userName;
	}

	/**
	 * Method returns authentication password of the current library user
	 * 
	 * @return userPassword
	 */
	public String getPassword()
	{	
		return this.userPassword;
	}
	
	/**
	 * Method returns identification number of the current library user
	 * 
	 * @return userID
	 */
	public int getId()
	{
		return userId;
	}
	/**
	 * Method sets name of library user
	 * 
	 * @param name name of library user
	 */
	public void setName(String name)
	{
		this.userName=name;
	}
	
	/**
	 * Method sets authentication password of library user
	 * 
	 * @param password  authentication password of library user
	 */
	public void setPassword(String password)
	{
		this.userPassword=password;
	}


	protected void setUserType(String userType) {
		this.userType = userType;
	}


	public String getUserType() {
		return userType;
	}

	public void setUserLogin(String userLogin) {
		this.userLogin = userLogin;
	}

	public String getUserLogin() {
		return userLogin;
	}


}

